<?php

/**
 * Aurorum - Open source digital signage
 *
 * @link http://digitalsignage.tk
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 * @category Aurorum
 * @package Aurorum
 */

/**
 * This class represents template engine. It's wrapper for Smarty.
 *
 * @package Aurorum
 * @subpackage Core
 */

class ADS_TemplateEngine extends Smarty{
    public function __construct() {
        parent::__construct();
        $this->template_dir = ADS_DIR . '/public/templates/';
        $this->config_dir   = ADS_DIR . '/app/libs/smarty/misc/config/';
        $this->compile_dir  = ADS_DIR . '/app/libs/smarty/misc/compiled/';
        $this->cache_dir    = ADS_DIR . '/app/libs/smarty/misc/cache/';
        
        $this->registerPlugin('function', 'link', 'ads_smarty_link');
        $this->registerPlugin('function', 'wp_nonce', 'ads_get_wp_nonce');
        $this->registerPlugin('function', 'sortlink', 'ads_smarty_sortlink');
        $this->registerPlugin('function', 'sortstate', 'ads_smarty_sortstate');
    }
}